//
//  GFWaitView.m
//  GoodFood
//
//  Created by dllo on 15/11/5.
//  Copyright © 2015年 荣伟峰. All rights reserved.
//

#import "GFWaitView.h"

@interface GFWaitView ()
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *label;
@end

@implementation GFWaitView
- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        
        [self setBackgroundColor:[UIColor whiteColor]];
        
        NSMutableArray *arr = [NSMutableArray array];
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
        self.imageView.center = CGPointMake(ScreenWidth / 2, ScreenHeight / 2);
        [self.imageView setBackgroundColor:[UIColor clearColor]];
        for (NSInteger i = 1; i < 19; i++) {
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"mm%ld", i]];
            [arr addObject:image];
        }
        [self addSubview:self.imageView];
        self.imageView.animationImages = arr;
        self.imageView.animationDuration = 3;
        self.imageView.animationRepeatCount = 0;
        [self.imageView startAnimating];
    
        
        self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 20)];
        self.label.center = CGPointMake(ScreenWidth / 2, ScreenHeight / 2 + 60);
        self.label.text = @"加载中...";
        [self addSubview:self.label];
        

        
    }
    return self;
}

@end
